#include<bits/stdc++.h>
using namespace std;
namespace fastio
{
	constexpr int S1=1<<20;
	char buf1[S1],*l1,*r1;
	inline char getc()
	{
		return ((l1==r1&&(r1=(l1=buf1)+fread(buf1,1,S1,stdin)),l1!=r1)?*l1++:EOF);
	}
	template<typename T=int>inline T read()
	{
		T x=0,y=1;
		char c=getc();
		for(;c<'0'||c>'9';c=getc())
			if(c=='-')
				y=-1;
		for(;c>='0'&&c<='9';c=getc())
			x=c-'0'+x*10;
		return x*y;
	}
	constexpr int S2=1<<20;
	char buf2[S2],*l2=buf2;
	inline void putc(char c)
	{
		l2==buf2+S2&&(fwrite(buf2,1,S2,stdout),l2=buf2),*l2++=c;
	}
	int st[22];
	template<typename T>inline void write(T x,char end='\n')
	{
		if(x<0)
			putc('-'),x=-x;
		int tp=0;
		do
			st[++tp]=x%10;
		while(x/=10);
		while(tp)
			putc(st[tp--]+'0');
		if(end)
			putc(end);
	}
	struct end
	{
		~end()
		{
			fwrite(buf2,1,l2-buf2,stdout);
		}
	}ender;
}
using fastio::getc;
using fastio::read;
using fastio::putc;
using fastio::write;
constexpr int MN=100005;
int a[MN];
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n=read();
	for(int i=1;i<=n;i++)
		a[i]=read();
	sort(a+1,a+n+1);
	int j=1;
	for(int i=1;i<=n;i++)
		if(a[i]>a[j])
			j++;
	printf("%d\n",n-j+1);
	return 0;
}